// pages/signeddetail/signeddetail.js
Page({
  mixins: [require('../../mixin/themeChanged')],

  /**
   * 页面的初始数据
   */
  data: {
    detail_hgId:'',
    detail_lrId:'',
    detail_address:'',
    detail_datatime_f:'',
    detail_datatime_s:'',
    detail_datatime_t:'',
    detail_status:'',
    detaildata:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options);
    var that = this;
    var hg_id = 19721473;       //需要获取到当前护工的ID
    wx.request({
      url: 'http://localhost:8080/weChat_sign/weChat_findSignListByStaffId?hg_id='+hg_id,
      data:hg_id,
      method:'GET',
      header:{
        'content-type': 'application/json' // 默认值
      },
      success:function(res){
        var requestList = res.data;
        console.log("获取到数据：",requestList);
        that.setData({
          detaildata:requestList
        })
        that.data.detaildata.forEach(item =>{
          if(options.id == item.id){
            that.setData({
              detail_hgId:item.hg_id,
              detail_lrId:item.lr_id,
              detail_address:item.address,
              detail_datatime_f:item.f_sign,
              detail_datatime_s:item.s_sign,
              detail_datatime_t:item.t_sign,
              detail_status:item.status
            })
          }
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})